﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace sy3_3_1_
{
    internal class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("===== 输入矩形信息 =====");
            Console.Write("请输入矩形长：");
            float rectLen = float.Parse(Console.ReadLine());
            Console.Write("请输入矩形宽：");
            float rectWid = float.Parse(Console.ReadLine());

            Rect rect = new Rect(rectLen, rectWid);
            Console.WriteLine($"结 果：矩形面积为 {rect.GetArea()}，周长为 {rect.GetPerimeter()}。\n");


            Console.WriteLine("===== 在矩形基础上构造矩体 =====");
            Console.Write("请输入矩体高：");
            float cuboldHei = float.Parse(Console.ReadLine());

            Cuboid cubold = new Cuboid(rectLen, rectWid, cuboldHei);
            Console.WriteLine($"结 果：矩体表面积为 {cubold.GetArea()}，体积为 {cubold.GetVolume()}。");

            Console.WriteLine("\n按任意键结束程序...");
            Console.ReadKey();
        }
    }
}
